package view.other
{
	import data.Globals;
	
	import flash.display.Sprite;
	import flash.filters.GlowFilter;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import flash.text.TextFormat;

	/**
	 * 能量牌 
	 * @author crazy chen
	 * 
	 */	
	public class GameInfoView extends Sprite
	{
		private var scoreTf:TextField;
		
		private var _score:int;
		
		private var wave:TextField;
		
		public function GameInfoView()
		{
			super();
			this.x = -300;
			initface();
		}
		
		private function initface():void
		{
			scoreTf = new TextField();
			this.addChild(scoreTf);
			scoreTf.defaultTextFormat = new TextFormat("Airal",20,0xffff00);
			scoreTf.autoSize = TextFieldAutoSize.RIGHT;
			scoreTf.text = score+"";
			scoreTf.y = -scoreTf.height/2;
			scoreTf.mouseEnabled = false;
			scoreTf.selectable = false;
			scoreTf.filters = [new GlowFilter(0x000000,0.8,3,3,4)];
			
			wave = new TextField();
			wave.defaultTextFormat = new TextFormat('',14,0xffffff);
			this.addChild(wave);
			wave.autoSize = TextFieldAutoSize.CENTER;
			wave.mouseEnabled = false;
			wave.selectable = false;
			wave.filters = [new GlowFilter(0x000000,0.8,3,3,4)];
			wave.x = 300;
			wave.y = 30;
		}

		public function get score():int
		{
			return _score;
		}

		public function set score(value:int):void
		{
			_score = value;
			scoreTf.text = _score + "";
		}
		
		public function setWave(cur:int,total:int):void{
			if(cur<=total){	
				wave.text = '第'+cur+'波，总共'+total+'波';
			}
		}

	}
}